package com.ldj.tim.common.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ldj.tim.common.pojo.P2PInfo;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author majinhui
 * @description
 * @create 2024/11/20 14:39
 **/
@Data
@TableName("im_user_msg_box")
@NoArgsConstructor
public class P2PInfoDTO {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String mid;
    private Long ownerUid;
    private Long otherUid;
    private Integer boxType;
    @TableField(exist = false)
    private Long timestamp;

    public P2PInfoDTO(P2PInfo info){
        this.mid = info.getMsgId();
        this.ownerUid = info.getOwnerUid();
        this.otherUid = info.getOtherUid();
        this.boxType = info.getBoxType();
        this.timestamp = info.getTimestamp();
    }
}
